{template 'common/header'}
<link rel="stylesheet" type="text/css" href="{MODULE_URL}template/style/main.css">

<div class="page-title">轮播图管理页面</div>

<div class="btn btn-success add-article">
	<a href="{php echo url('site/entry/BannerEdit', array('m' => 'yts_qiye'));}">新增轮播图</a>

</div>


<div class="panel panel-info">
	<div class="panel-heading">筛选</div>
	<div class="panel-body">
	   <form action="" method="post" class="form-inline" id="setting-form">
		<div class="form-group col-sm-3">
			<label class="col-xs-12 col-sm-4 col-md-2 col-lg-3 control-label"> 位置</label>
			<div class="col-sm-8 col-lg-8">
					<select name="type_position" >
						
							<option value="0" {if !$type_position} selected="selected" {/if} >全部</option>
							<option value="1"  {if $type_position == 1} selected="selected" {/if} >首页</option>
							<option value="2"  {if $type_position == 2} selected="selected" {/if} >列表页</option>
						
					</select>
			
			</div>                  
		</div>
		<div class="form-group col-sm-3">
			<label class="col-xs-12 col-sm-4 col-md-2 col-lg-3 control-label">  跳转类型</label>
			<div class="col-sm-8 col-lg-8">

					<select name="type_skip" >
						
							<option value="0" {if !$type_skip} selected="selected" {/if} >全部</option>
							<option value="1" {if $type_skip == 1} selected="selected" {/if}>超链接</option>
							<option value="2" {if $type_skip == 2} selected="selected" {/if} >小程序</option>
						
					</select>


				
			</div>                  
		</div>



			<div class="form-group">
				<div class="col-sm-offset-1 col-sm-12">
				  <input type="submit" name="submit" value="搜索">
				  <input type="hidden" name="token" value="{$_W['token']}" />
				</div>
			</div>
		</form>
	</div>
</div>

<table class="table table-striped table-bordered table-hover">
    <thead>
    <tr >
        <th>ID</th>
        <th>标题</th>
		<th>作者</th>
	
		<th>图片</th>
		<th>位置</th>
		<th>跳转类型</th>
		<th>跳转地址</th>
        <th>提交时间</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
	
	{loop $formresult $index $item}
	
	<tr>
	    <td>{$item['id']}</td>
		<td>{$item['title']}</td>
	
		<td>{$item['user']['username']}</td>
		<td class="text-center"><img class="pic" src="{$item['img_path']}"></td>
		<td>{if $item['type_position'] == 1}首页{else}列表页{/if}</td>
		<td>{if $item['type_skip'] == 1}超链接{else}小程序{/if}</td>
		<td>{$item['url']}</td>
	    <td>{php echo date('Y-m-d H:i:s', $item['add_time'])}</td>
	    <td>

				<a href="{php echo $this->createWebUrl('bannerdel',array('id' => $item['id']))}" onclick="return confirm('你确定要删除吗？')" 
						class="btn btn-danger">删除</a>

			<a class="btn btn-success" href="{php echo url('site/entry/BannerEdit', array('m' => 'yts_qiye','id'=>$item['id'],'op'=>'edit'));}">编辑</a>
		</td>
	</tr>
	{/loop}
    </tbody>
</table>
<div class="showPage">{$_pagination_var}</div>

{template 'common/footer'}